package com.wu.dms.constant;

/**
 * @author Cousin
 * @date 2024/12/25
 * @Description
 */
public enum CountryEnum {

    SOUTH_KOREA("South Korea", "韩国"),
    CHINA("CHINA", "中国"),
    ITALY("Italy", "意大利"),
    SINGAPORE("Singapore", "新加坡"),
    UNITED_STATES("United States", "美国"),
    MALAYSIA("Malaysia", "马来西亚"),
    SPAIN("Spain", "西班牙"),
    CANADA("Canada", "加拿大"),
    GERMANY("Germany", "德国"),
    JAPAN("Japan", "日本"),
    UNITED_KINGDOM("United Kingdom", "英国"),
    NORWAY("Norway", "挪威"),
    SWEDEN("Sweden", "瑞典");

    private final String englishName;
    private final String chineseName;

    // 构造函数
    CountryEnum(String englishName, String chineseName) {
        this.englishName = englishName;
        this.chineseName = chineseName;
    }

    // 获取英文名称
    public String getEnglishName() {
        return englishName;
    }

    // 获取中文名称
    public String getChineseName() {
        return chineseName;
    }

    // 根据英文名称查找对应的中文名称
    public static String getCountryByLocation(String location) {
        for (CountryEnum countryEnum : CountryEnum.values()) {
            if (location.contains(countryEnum.chineseName)) {
                return countryEnum.getChineseName();
            }
        }
        return null;
    }

}

